package br.edu.utfpr.backupTools.view.action.backup;

import br.edu.utfpr.backupTools.controller.ControladorBackupImpl;
import br.edu.utfpr.backupTools.controller.interfaces.ControladorBackup;
import br.edu.utfpr.backupTools.controller.validator.BackupValidator;
import br.edu.utfpr.backupTools.model.dao.DaoBackupImpl;
import br.edu.utfpr.backupTools.model.dao.interfaces.DaoBackup;
import br.edu.utfpr.backupTools.model.pojo.Backup;
import br.edu.utfpr.backupTools.view.action.AbstractCommand;
import br.edu.utfpr.comum.RetornoValidacao;

public class ExcluirBackup extends AbstractCommand<Backup>{
	
	@Override
	public RetornoValidacao execute(Backup bean) {
		
		try {
			controlador.excluir(bean);
			return new RetornoValidacao();
		} catch (Exception e) {
			e.printStackTrace();
			return new RetornoValidacao("Ocorreu um erro ao excluir o backup selecionado");
		}
	}

}
